#ifndef _core_switch_case_sequence_hpp_
#define _core_switch_case_sequence_hpp_

/** \file case_sequence.hpp
 *  \author Adrian Schweizer
 *  \created  $Mo 11 Feb 08:33:01 pm CET 2008 schwadri@SchwadriLaptop.local$
 *  \modified $Mo 11 Feb 08:34:06 pm CET 2008 schwadri@SchwadriLaptop.local$
 */

#include <boost/mpl/void.hpp>

namespace core {

    struct  case_tag;

    template <typename Labels, typename Functor, typename Next=boost::mpl::void_>
        struct case_sequence
        {
            case_sequence(const Functor& f, const Next& n = Next())
            :   m_f(f),
                m_next(n)
            { }

            typedef Labels              labels;
            typedef Functor             functor;
            typedef Next                next;

            template <typename L, typename F>
                case_sequence<L,F,case_sequence<Labels,Functor,Next> >    operator,(const case_sequence<L,F,boost::mpl::void_>& c) const
                {
                    return  case_sequence<L,F,case_sequence<Labels,Functor,Next> >(c.f(),*this);
                }
            const functor&  f() const   { return m_f; }
        private:
            const Functor&  m_f;
            Next            m_next;
        };

} // namespace core

#endif // _core_switch_case_sequence_hpp_
